#include "Ground.h"
#include "ResourceManager.h"
#include <d3dx9.h>

Ground::Ground(int id,float x, float y, int type)
{
	if(type == 35)
	{
		_sprite = new Sprite(_spriteHandler, ResourceManager::GetInstance()->GetTexture(ResourceManager::GetInstance()->TextureName.Ground_Left),0, 0);
		_id = id;
		_x = x;
		_y = y;
	}
	if(type == 36)
	{
		_sprite = new Sprite(_spriteHandler, ResourceManager::GetInstance()->GetTexture(ResourceManager::GetInstance()->TextureName.Ground_Middle),0, 0);
		_id = id;
		_x = x;
		_y = y;
	}
	if(type == 37)
	{
		_sprite = new Sprite(_spriteHandler, ResourceManager::GetInstance()->GetTexture(ResourceManager::GetInstance()->TextureName.Ground_Right),0, 0);
		_id = id;
		_x = x;
		_y = y;
	}
	_width = _sprite->getTexture()->getWidth();
	_height = _sprite->getTexture()->getHeight();
}

Ground::~Ground(void)
{
	if (_sprite)
	{
		delete _sprite;
	}
	
}

void Ground::Update(list<Object *> *_list, float time)
{
}


void Ground:: Render(int vpX, int vpY)
{
	_sprite->Render(_x, _y, vpX, vpY);
}

OBJECT_TYPE Ground::getObjectType()
{
	return OBJECT_STATIC;
}